from django.db import models

# Create your models here.
class Lab(models.Model):
    name = models.CharField(max_length=32,verbose_name='实验室名称')
    floor = models.IntegerField(verbose_name='楼层')
    room = models.IntegerField(verbose_name='房间号')
    username = models.ManyToManyField('User')


class Asset(models.Model):
    name = models.CharField(max_length=32,verbose_name='物资名称')
    describe = models.TextField(verbose_name='物资描述')
    num = models.CharField(max_length=60,verbose_name='物资编号')
    time = models.DateTimeField(verbose_name='购买时间',auto_now_add=True)
    people = models.ManyToManyField('User') # 一件物资可以被多个人买，一个人也可以买多种物资


class User(models.Model):
    user = models.CharField(max_length=32,verbose_name='用户名')
    pwd = models.CharField(max_length=50,verbose_name='用户密码')
    name = models.CharField(max_length=32,verbose_name='姓名')
    phon = models.CharField(max_length=32,verbose_name='手机号')


list=[Lab,Asset,User]
